<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:awc="clr-namespace:Assergs.Windows.Controls"
    xmlns:aw="clr-namespace:Assergs.Windows"
	>
    
    <Style x:Key="ButtonFocusVisualStyle">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border
						CornerRadius="2.5"
						BorderBrush="#F6CF57"
						BorderThickness="2"
						/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <SolidColorBrush x:Key="ForegroundColorBrush" Color="{x:Static aw:ButtonPallet.Font}"/>
    <SolidColorBrush x:Key="NormalBorderBrush" Color="{x:Static aw:ButtonPallet.NormalBorderBrush}"></SolidColorBrush>
    <SolidColorBrush x:Key="LightBorderBrush" Color="{x:Static aw:ButtonPallet.LightBorderBrush}"/>
    <SolidColorBrush x:Key="PlusLightBorderBrush" Color="{x:Static aw:ButtonPallet.PlusLightBorderBrush}"/>
    <SolidColorBrush x:Key="DisabledBorderBrush" Color="{x:Static aw:ButtonPallet.DisabledBorderBrush}"/>
    <SolidColorBrush x:Key="DisabledForegroundBrush" Color="{x:Static aw:OfficeColors+Disabled.OfficeColor4}"/>
    
    <LinearGradientBrush x:Key="NormalBackGroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Color="{x:Static aw:ButtonPallet.NormalBackGroundBrush1}" Offset="0"/>
        <GradientStop Color="{x:Static aw:ButtonPallet.NormalBackGroundBrush2}" Offset="0.4"/>
        <GradientStop Color="{x:Static aw:ButtonPallet.NormalBackGroundBrush3}" Offset="0.4"/>
        <GradientStop Color="{x:Static aw:ButtonPallet.NormalBackGroundBrush4}" Offset="1"/>
	</LinearGradientBrush>
    
    <LinearGradientBrush x:Key="LightBackGroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Offset="0" Color="{x:Static aw:ButtonPallet.DefaultControlMouseOver1}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ButtonPallet.DefaultControlMouseOver2}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ButtonPallet.DefaultControlMouseOver3}" />
		<GradientStop Offset="1" Color="{x:Static aw:ButtonPallet.DefaultControlMouseOver4}" />
	</LinearGradientBrush>
    
    <LinearGradientBrush x:Key="PlusLightBackGroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
		<GradientStop Offset="0" Color="{x:Static aw:ButtonPallet.DefaultControlPressed1}" />
		<GradientStop Offset="0.1" Color="{x:Static aw:ButtonPallet.DefaultControlPressed2}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ButtonPallet.DefaultControlPressed3}" />
		<GradientStop Offset="0.4" Color="{x:Static aw:ButtonPallet.DefaultControlPressed4}" />
		<GradientStop Offset="1" Color="{x:Static aw:ButtonPallet.DefaultControlPressed5}" />
	</LinearGradientBrush>
    
    <LinearGradientBrush x:Key="DisableBackGroundBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="{x:Static aw:ButtonPallet.DisableBackGroundBrush1}"></GradientStop>
        <GradientStop Color="{x:Static aw:ButtonPallet.DisableBackGroundBrush2}"></GradientStop>
    </LinearGradientBrush>

    <Style TargetType="Button">
        <Setter Property="MinHeight" Value="23"/>
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="Foreground" Value="{StaticResource ForegroundColorBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisualStyle}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">

                    <Border x:Name="masterBorder" SnapsToDevicePixels="True"
                            BorderThickness="1"
                            Background="{StaticResource NormalBackGroundBrush}"
                            BorderBrush="{StaticResource NormalBorderBrush}"
                            CornerRadius="2">
                        <ContentPresenter
                            Margin="2"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            RecognizesAccessKey="True"/>
                    </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="masterBorder" Property="Background" Value="{StaticResource LightBackGroundBrush}" />
                            <Setter TargetName="masterBorder" Property="BorderBrush" Value="{StaticResource LightBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="masterBorder" Property="Background" Value="{StaticResource PlusLightBackGroundBrush}" />
                            <Setter TargetName="masterBorder" Property="BorderBrush" Value="{StaticResource PlusLightBorderBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="masterBorder" Property="Background" Value="{StaticResource DisableBackGroundBrush}" />
                            <Setter TargetName="masterBorder" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}"/>
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                        <Trigger Property="IsDefault" Value="True">
                            <Setter TargetName="masterBorder" Property="BorderBrush" Value="{StaticResource LightBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <!--<Setter TargetName="masterBorder" Property="Background" Value="{StaticResource LightBackGroundBrush}" />-->
                            <Setter TargetName="masterBorder" Property="BorderBrush" Value="{StaticResource LightBorderBrush}" />
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

</ResourceDictionary>